package org.happy.tester.common.util;

import org.apache.commons.lang3.StringUtils;
import org.happy.tester.common.http.OkHttpClientUtil;
import org.happy.tester.common.http.OkHttpRequestProvider;

import java.io.IOException;
import java.util.HashMap;

/**
 * @Classname InternetUtils
 * @Description TODO
 * @Date 2020/7/1 12:45 上午
 * @Created by jc.bai
 */
public class InternetUtils {

    public static String getOutSideIp() throws IOException {
        return "114.242.175.188";
        /*OkHttpRequestProvider requestProvider = new OkHttpRequestProvider();
        requestProvider.setRootPath("https://ifconfig.co");
        requestProvider.setPath("/ip");
        requestProvider.setHeaders(new HashMap<>());
        OkHttpClientUtil okHttpClientUtil = new OkHttpClientUtil();
        okHttpClientUtil.setRequestProvider(requestProvider);
        okHttpClientUtil.setParamMap(new HashMap<>());
        String result = okHttpClientUtil.doSyncGet();
        while (StringUtils.isEmpty(result)) {
            result = getOutSideIp();
        }
        result = result.split("\n")[0];
        return result;*/
    }
}
